﻿using System.Security.Principal;
using System.Web;
using Project.MVC.PhanQuyen.Model;
namespace Project.MVC.PhanQuyen.Services
{
    public static class AuthorizeHelper
    {
        public static VuViecEnum GetTasks(this IIdentity identity)
        {
            VuViecEnum tasks = 0x0;
            if (identity.IsAuthenticated)
            {
                WSUserPrincipal principal = (WSUserPrincipal)HttpContext.Current.Cache.Get(identity.Name);
                if (principal != null)
                    tasks = principal.Tasks;
            }
            return tasks;
        }
    }
}
